/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package im.clusterhead;

import im.general.AbstractListenBehaviour;
import im.general.Config;
import im.messages.BaseMessage;
import im.messages.MessagePayload;
import jade.core.AID;
import jade.lang.acl.ACLMessage;
import jade.lang.acl.MessageTemplate;

/**
 *
 * @author bluejack
 */
public class ClusterHeadListenBehaviour extends AbstractListenBehaviour {
    
    ClusterHeadAgent ch;
    
    ClusterHeadListenBehaviour(ClusterHeadAgent ch) {
        this.ch = ch;
        mt = MessageTemplate.MatchPerformative(BaseMessage.NOTIFY);
    }

    @Override
    protected void handleMessage(ACLMessage msg) {
        System.out.println("ho ricevuto un messaggio di notify! ^^");
    }

        /*@Override
    protected void manageMessage(ACLMessage msg) {
    MessagePayload pl = null;
    pl = getMessagePayload(msg);


    switch(pl.getType()) {

    case Config.NOTIFY:
    notifyToCluster(msg);
    break;

    case Config.PUBLISH_CH:
    forwardToEventService(msg);

    pl.setType(Config.NOTIFY);
    setMessagePayload(msg, pl);
    forwardToClusterHeads(msg);
    break;
    }
    }*/

    /*protected void forwardToEventService(ACLMessage msg) {

    }

    protected void forwardToClusterHeads(ACLMessage msg) {

    }

    protected void notifyToCluster(ACLMessage msg) {

    }*/
}
